<template>
<!-- 此处记得要把自带的div删除 -->
  <tr>
    <td>{{item.id}}</td>
    <td>{{item.name}}</td>
    <td>{{item.date | newTime('-')}}</td>
    <td>
      <button
      @click="onDel"
      :disabled="listLength<=1?true:false"
      >删除</button><button
      @click="onRedact"
      >编辑</button>
    </td>
  </tr>
</template>

<script>
export default {
  data () {
    return {
      flag: false
    }
  },

  props: {
    item: {
      type: Object,
      require: true
    },
    listLength: {
      require: true
    }
  },

  created () {

  },

  methods: {
    onDel () {
      // console.log(this.item.id)
      this.$emit('on-del', this.item.id)
    },
    onRedact () {
      this.$emit('on-redact', this.item.id)
    }
  }
}
</script>

<style scoped lang='less'>

</style>
